<template>
  <Row :gutter="16">
    <Col span="8">
    <Card>
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>重置用户头像</span>
        </p>
      </template>
      <Form ref="userAvatarForm" :rules="ruleValidate" :model="avatarFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="avatarFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏"
            :disabled="AvatarFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="avatarFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
            :disabled="AvatarFormSetting.index !== 0" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0px">
        <Button type="text" @click="clearAvatarForm" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitUserAvatar" :loading="AvatarFormSetting.loading">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>重置角色技能</span>
        </p>
      </template>
      <Form ref="roleSkillForm" :rules="ruleValidate" :model="roleSkillFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="roleSkillFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏"
            :disabled="RoleSkillFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="roleSkillFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
            :disabled="RoleSkillFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="roleSkillFormItem.hero_id" style="width: 100%" :disabled="RoleSkillFormSetting.index !== 0">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0px">
        <Button type="text" @click="clearRoleSkillForm" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitRoleSkill" :loading="roleSkillFormItem.loading">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>充值金手指</span>
        </p>
      </template>
      <Form ref="orderForm" :rules="orderRuleValidate" :model="orderFormItem" :label-width="100">
        <FormItem label="订单号" prop="order_num">
          <Input v-model="orderFormItem.order_num" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitOrder">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>线下充值</span>
        </p>
      </template>
      <Form ref="offlineTopUpForm" :rules="offlineTopUpRuleValidate" :model="offlineTopUpFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="offlineTopUpFormItem.game_hash" filterable clearable remote style="width: 100%"
            placeholder="请选择游戏" :disabled="offlineTopUpFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="游戏版本" prop="version">
          <Select v-model="offlineTopUpFormItem.version" style="width: 100%" clearable
            :disabled="offlineTopUpFormSetting.index !== 0">
            <Option :value="`4.0.2`">生产-微信服</Option>
            <Option :value="`4.0.2`">生产-抖音服</Option>
            <Option :value="`4.0.3`">测试服</Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="offlineTopUpFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" />
        </FormItem>
        <FormItem label="目标平台" prop="platform">
          <Select v-model="offlineTopUpFormItem.platform" style="width: 100%" clearable
            :disabled="offlineTopUpFormSetting.index !== 0">
            <Option :value="1">IOS</Option>
            <Option :value="2">安卓</Option>
          </Select>
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="offlineTopUpFormItem.hero_id" style="width: 100%" clearable
            :disabled="offlineTopUpFormSetting.index !== 0">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
        <FormItem label="档位" prop="gear">
          <Select v-model="offlineTopUpFormItem.gear" style="width: 100%" clearable
            :disabled="offlineTopUpFormSetting.index !== 0">
            <Option :value="7000">多倍返6480</Option>
            <Option :value="7001">多倍返8000</Option>
            <Option :value="7002">多倍返12960</Option>
            <Option :value="7003">多倍返19440</Option>
            <Option :value="7004">多倍返小额128</Option>
            <Option :value="7005">多倍返小额198</Option>
            <Option :value="7006">多倍返小额328</Option>
            <Option :value="7007">多倍返小额648</Option>
          </Select>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitOffline">提交</Button>
      </div>
      <Modal v-model="modal1" title="二次确认" @on-ok="ok" @on-cancel="cancel">
        <Form :model="offlineTopUpFormItem" :label-width="100">
          <FormItem label="目标游戏" prop="game_hash">
            <Select v-model="offlineTopUpFormItem.game_hash" filterable clearable remote style="width: 100%"
              placeholder="请选择游戏" disabled>
              <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
              </Option>
            </Select>
          </FormItem>
          <FormItem label="游戏版本" prop="version">
            <Select v-model="offlineTopUpFormItem.version" style="width: 100%" clearable disabled>
              <Option :value="`4.0.2`">生产-微信服</Option>
              <Option :value="`4.0.2`">生产-抖音服</Option>
              <Option :value="`4.0.3`">测试服</Option>
            </Select>
          </FormItem>
          <FormItem label="目标OpenId" prop="openid">
            <Input v-model="offlineTopUpFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
              disabled />
          </FormItem>
          <FormItem label="目标平台" prop="platform">
            <Select v-model="offlineTopUpFormItem.platform" style="width: 100%" clearable disabled>
              <Option :value="1">IOS</Option>
              <Option :value="2">安卓</Option>
            </Select>
          </FormItem>
          <FormItem label="目标角色" prop="hero_id">
            <Select v-model="offlineTopUpFormItem.hero_id" style="width: 100%" clearable disabled>
              <!-- <Option :value="1001">驭剑者(1001)</Option> -->
              <Option :value="1002">剑影（狐狸）(1002)</Option>
              <Option :value="1004">炎刃（狼）(1004)</Option>
              <Option :value="1005">灵剑师（虎）(1005)</Option>
              <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
            </Select>
          </FormItem>
          <FormItem label="档位" prop="gear">
            <Select v-model="offlineTopUpFormItem.gear" style="width: 100%" clearable disabled>
              <Option :value="7000">多倍返6480</Option>
              <Option :value="7001">多倍返8000</Option>
              <Option :value="7002">多倍返12960</Option>
              <Option :value="7003">多倍返19440</Option>
              <Option :value="7004">多倍返小额128</Option>
              <Option :value="7005">多倍返小额198</Option>
              <Option :value="7006">多倍返小额328</Option>
              <Option :value="7007">多倍返小额648</Option>
            </Select>
          </FormItem>
        </Form>
      </Modal>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>每日累充返利</span>
        </p>
      </template>
      <Form ref="dailyRechargeForm" :rules="dailyRechargeRuleValidate" :model="dailyRechargeFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="dailyRechargeFormItem.game_hash" filterable clearable remote style="width: 100%"
            placeholder="请选择游戏" :disabled="dailyRechargeFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="dailyRechargeFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="dailyRechargeFormItem.hero_id" style="width: 100%" clearable
            :disabled="dailyRechargeFormSetting.index !== 0">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
        <FormItem label="档位" prop="gear">
          <Select v-model="dailyRechargeFormItem.gear" style="width: 100%" clearable
            :disabled="dailyRechargeFormSetting.index !== 0">
            <Option :value="7100">100元返</Option>
            <Option :value="7101">500元返</Option>
            <Option :value="7102">1000元返</Option>
            <Option :value="7103">3000元返</Option>
            <Option :value="7104">5000元返</Option>
            <Option :value="7105">10000元返</Option>
            <Option :value="7106">20000元返</Option>
          </Select>
        </FormItem>
        <FormItem label="返利日期">
          <DatePicker type="date" format="yyyy-MM-dd" v-model="dailyRechargeFormItem.checkDate" style="width: 100%" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitDailyRecharge">提交</Button>
      </div>
    </Card>
    </Col>
    <Col span="8">
    <Card>
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>重置角色进度</span>
        </p>
      </template>
      <Form ref="lastDungeonForm" :rules="ruleValidate" :model="dungeonFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="dungeonFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏"
            :disabled="DungeonFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="dungeonFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
            :disabled="DungeonFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="dungeonFormItem.hero_id" style="width: 100%" :disabled="DungeonFormSetting.index !== 0">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
        <FormItem label="最新进度" prop="last_dungeon">
          <Input v-model="dungeonFormItem.last_dungeon" type="textarea" :autosize="{ minRows: 5, maxRows: 8 }" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="text" @click="clearDungeonFormItem" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitLastDungeon" :loading="DungeonFormSetting.loading">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>生成指定装备</span>
        </p>
      </template>
      <Form ref="createEquipmentForm" :rules="createValidate" :model="createEquipmentFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="createEquipmentFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏"
            :disabled="CreateEquipmentFormSetting.index !== 0">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="createEquipmentFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
            :disabled="CreateEquipmentFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="createEquipmentFormItem.hero_id" style="width: 100%"
            :disabled="CreateEquipmentFormSetting.index !== 0">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
        <FormItem label="装备id" prop="item_id">
          <Input v-model="createEquipmentFormItem.item_id" :disabled="CreateEquipmentFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="额外效果id" prop="extra_effect_id">
          <Input v-model="createEquipmentFormItem.extra_effect_id" :disabled="CreateEquipmentFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="深渊气息" prop="is_abyss">
          <i-Switch v-model="createEquipmentFormItem.is_abyss" :disabled="CreateEquipmentFormSetting.index !== 0">
            <span slot="open">开</span>
            <span slot="close">关</span>
          </i-Switch>
        </FormItem>
        <FormItem label="深渊效果id" prop="abyss_effect_id" v-if="createEquipmentFormItem.is_abyss">
          <Input v-model="createEquipmentFormItem.abyss_effect_id" :disabled="CreateEquipmentFormSetting.index !== 0" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0px">
        <Button type="text" @click="clearCreateEquipmentForm" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitCreateEquipment" :loading="createEquipmentFormItem.loading">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>跑马灯</span>
        </p>
      </template>
      <Form ref="closeForm" :rules="closeRuleValidate" :model="closeFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="closeFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="自定义内容" prop="time">
          <Input type="textarea" v-model="closeFormItem.content" style="width: 100%" />
        </FormItem>
        <FormItem label="开始时间" prop="time">
          <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="closeFormItemTime" style="width: 100%" />
        </FormItem>
        <FormItem label="结束时间" prop="time">
          <DatePicker type="datetime" format="yyyy-MM-dd HH:mm" v-model="closeFormItemEndTime" style="width: 100%" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitClose">提交</Button>
      </div>
    </Card>
    </Col>
    <Col span="8">
    <Card>
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>Unique计算器</span>
        </p>
      </template>
      <Form ref="lastDungeonForm" :model="uniqueFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="uniqueFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="uniqueFormItem.openid" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
            :disabled="DungeonFormSetting.index !== 0" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="uniqueFormItem.hero_id" style="width: 100%">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
        <FormItem label="Unique" prop="Unique">
          <Input v-model="unique" :disabled="true" />
        </FormItem>
        <FormItem label="当前进度" prop="LastDungeon">
          <Input type="textarea" v-model="last_dungeon" :disabled="true" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitUnique">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>GM系统消息</span>
        </p>
      </template>
      <Form ref="gmForm" :rules="gmRuleValidate" :model="gmFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="gmFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="消息内容" prop="message">
          <Input v-model="gmFormItem.message" type="textarea" :autosize="{ minRows: 5, maxRows: 8 }" />
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitGm">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>清除战令领取记录</span>
        </p>
      </template>
      <Form ref="clearRoleWarOrderForm" :model="clearFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="clearFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="目标OpenId" prop="openid">
          <Input v-model="clearFormItem.openid" :autosize="{ minRows: 3, maxRows: 5 }" />
        </FormItem>
        <FormItem label="目标角色" prop="hero_id">
          <Select v-model="clearFormItem.hero_id" style="width: 100%">
            <!-- <Option :value="1001">驭剑者(1001)</Option> -->
            <Option :value="1002">剑影（狐狸）(1002)</Option>
            <Option :value="1004">炎刃（狼）(1004)</Option>
            <Option :value="1005">灵剑师（虎）(1005)</Option>
            <Option :value="1006">双弩游侠（猞猁）(1006)</Option>
          </Select>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitClear">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>全服禁言</span>
        </p>
      </template>
      <Form ref="muteForm" :rules="muteRuleValidate" :model="muteFormItem" :label-width="100">
        <FormItem label="目标游戏" prop="game_hash">
          <Select v-model="muteFormItem.game_hash" filterable remote style="width: 100%" placeholder="请选择游戏">
            <Option v-for="(option, index) in gameNameOption" :value="option.value" :key="index">{{ option.label }}
            </Option>
          </Select>
        </FormItem>
        <FormItem label="动作" prop="mute">
          <Select v-model="muteFormItem.mute" style="width: 100%">
            <Option :value="1">全服禁言</Option>
            <Option :value="0">解除禁言</Option>
          </Select>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="primary" @click="submitMute">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>获取APP强制更新</span>
        </p>
      </template>
      <Form ref="appUpdateForm" :rules="ruleValidate" :model="appUpdateFormItem" :label-width="100">
        <FormItem label="服务器" prop="is_test">
          <Select v-model="appUpdateFormItem.is_test" style="width: 100%" :disabled="AppUpdateFormSetting.index !== 0">
            <Option :value="0">正式服</Option>
            <Option :value="1">测试服</Option>
          </Select>
        </FormItem>
        <FormItem label="更新内容" prop="info">
          <Input v-model="appUpdateFormItem.info" type="textarea" :autosize="{ minRows: 5, maxRows: 8 }" disabled/>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="text" @click="clearAppUpdateFormItem" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitAppUpdate" :loading="AppUpdateFormSetting.loading">提交</Button>
      </div>
    </Card>
    <Card style="margin-top: 15px">
      <template #title>
        <p slot="header" style="color: #2d8cf0">
          <Icon type="md-alert" />
          <span>保存APP强制更新</span>
        </p>
      </template>
      <Form ref="saveAppUpdateForm" :rules="ruleValidate" :model="saveAppUpdateFormItem" :label-width="100">
        <FormItem label="服务器" prop="is_test">
          <Select v-model="saveAppUpdateFormItem.is_test" style="width: 100%" :disabled="SaveAppUpdateFormSetting.index !== 0">
            <Option :value="0">正式服</Option>
            <Option :value="1">测试服</Option>
          </Select>
        </FormItem>
        <FormItem label="更新内容" prop="info">
          <Input v-model="saveAppUpdateFormItem.info" type="textarea" :autosize="{ minRows: 5, maxRows: 8 }"/>
        </FormItem>
      </Form>
      <div class="ivu-modal-footer" style="padding-bottom: 0">
        <Button type="text" @click="clearSaveAppUpdateFormItem" class="margin-right-10">清空</Button>
        <Button type="primary" @click="submitSaveAppUpdate" :loading="SaveAppUpdateFormSetting.loading">提交</Button>
      </div>
    </Card>
    </Col>
  </Row>
</template>

<script>
import {
  userAvatar,
  lastDungeon,
  getRoleUnique,
  closeServer,
  roleSkill,
  backOrder,
  mute,
  createEquipment,
  offlineTopUp,
  clearRoleWarOrder,
  getAppUpdate,
  saveAppUpdate,
  dailyRecharge
} from '@/api/game-tools'
import { add } from '@/api/game-chat'
import { getChoose } from '@/api/game-manager'

export default {
  name: 'operate-tools',
  data () {
    return {
      gameNameOption: [],
      unique: '',
      last_dungeon: '',
      gameShow: {},
      closeFormItemTime: '',
      closeFormItemEndTime: '',
      orderFormItem: {
        order_num: ''
      },
      muteFormItem: {
        game_hash: '',
        mute: 0
      },
      avatarFormItem: {
        game_hash: '',
        openid: ''
      },
      roleSkillFormItem: {
        game_hash: '',
        hero_id: '',
        openid: ''
      },
      createEquipmentFormItem: {
        game_hash: '',
        hero_id: '',
        openid: '',
        item_id: '',
        extra_effect_id: '',
        is_abyss: false,
        abyss_effect_id: ''
      },
      dungeonFormItem: {
        game_hash: '',
        openid: '',
        hero_id: '',
        last_dungeon: ''
      },
      appUpdateFormItem: {
        is_test: '',
        info: ''
      },
      saveAppUpdateFormItem: {
        is_test: '',
        info: ''
      },
      uniqueFormItem: {
        game_hash: '',
        openid: '',
        hero_id: ''
      },
      clearFormItem: {
        game_hash: '',
        openid: '',
        hero_id: ''
      },
      offlineTopUpFormItem: {
        game_hash: '',
        version: '',
        openid: '',
        hero_id: '',
        gear: '',
        platform: ''
      },
      dailyRechargeFormItem: {
        game_hash: '',
        openid: '',
        hero_id: '',
        gear: '',
        checkDate: ''
      },
      closeFormItem: {
        game_hash: '',
        content: '',
        start_time: '',
        end_time: ''
      },
      gmFormItem: {
        game_hash: '',
        message: ''
      },
      AvatarFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      RoleSkillFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      CreateEquipmentFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      DungeonFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      AppUpdateFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      SaveAppUpdateFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      offlineTopUpFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      dailyRechargeFormSetting: {
        show: false,
        loading: false,
        index: 0
      },
      modal1: false,
      ruleValidate: {
        game_hash: [{ required: true, message: '请选择游戏', trigger: 'blur' }],
        openid: [{ required: true, message: '请填写openid', trigger: 'blur' }],
        hero_id: [
          {
            required: true,
            message: '请选择角色',
            trigger: 'blur',
            type: 'number'
          }
        ],
        last_dungeon: [
          { required: true, message: '请填写最新进度', trigger: 'blur' }
        ]
      },
      closeRuleValidate: {
        game_hash: [{ required: true, message: '请选择游戏', trigger: 'blur' }]
      },
      offlineTopUpRuleValidate: {
        game_hash: [{ required: true, message: '请选择游戏', trigger: 'blur' }],
        openid: [{ required: true, message: '请填写openid', trigger: 'blur' }],
        platform: [
          {
            required: true,
            message: '请选择平台',
            trigger: 'blur',
            type: 'number'
          }
        ],
        version: [
          {
            required: true,
            message: '请选择版本号',
            trigger: 'blur',
            type: 'string'
          }
        ],
        hero_id: [
          {
            required: true,
            message: '请选择角色',
            trigger: 'blur',
            type: 'number'
          }
        ],
        gear: [
          {
            required: true,
            message: '请选择档位',
            trigger: 'blur',
            type: 'number'
          }
        ]
      },
      dailyRechargeRuleValidate: {
        game_hash: [{ required: true, message: '请选择游戏', trigger: 'blur' }],
        openid: [{ required: true, message: '请填写openid', trigger: 'blur' }],
        checkDate: [{ required: true, message: '请选择日期', trigger: 'blur' }],
        hero_id: [
          {
            required: true,
            message: '请选择角色',
            trigger: 'blur',
            type: 'number'
          }
        ],
        gear: [
          {
            required: true,
            message: '请选择档位',
            trigger: 'blur',
            type: 'number'
          }
        ]
      },
      gmRuleValidate: {
        game_hash: [{ required: true, message: '请选择游戏', trigger: 'blur' }],
        message: [
          { required: true, message: '请填写消息内容', trigger: 'blur' }
        ]
      },
      orderRuleValidate: {
        order_num: [
          { required: true, message: '订单号不能为空', trigger: 'blur' }
        ]
      },
      muteRuleValidate: {
        game_hash: [
          { required: true, message: '请选择游戏', trigger: 'blur' }
        ]
      }
    }
  },
  created () {
    let vm = this
    vm.getGameName()
  },
  methods: {
    ok () {
      let that = this
      that.offlineTopUpFormSetting.loading = true
      offlineTopUp(that.offlineTopUpFormItem).then(response => {
        that.$Message.success(response.data.msg)
        that.$refs['offlineTopUpForm'].resetFields()
        that.offlineTopUpFormSetting.loading = false
      }).catch(() => {
        that.offlineTopUpFormSetting.loading = false
      })
    },
    cancel () {
    },
    getGameName (value) {
      if (!this.gameNameOption.length) {
        getChoose({
          keyword: value
        }).then((response) => {
          this.gameNameOption = response.data.data.list
          this.gameNameOption.forEach((i) => {
            this.gameShow[i.value] = i.label
          })
        })
      }
    },
    submitUserAvatar () {
      let vm = this
      this.$refs['userAvatarForm'].validate((valid) => {
        if (valid) {
          vm.AvatarFormSetting.loading = true
          userAvatar(vm.avatarFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              vm.clearAvatarForm()
              vm.AvatarFormSetting.loading = false
            })
            .catch(() => {
              vm.AvatarFormSetting.loading = false
            })
        }
      })
    },
    submitCreateEquipment () {
      let vm = this
      this.$refs['createEquipmentForm'].validate((valid) => {
        if (valid) {
          vm.CreateEquipmentFormSetting.loading = true
          createEquipment(vm.createEquipmentFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              vm.clearCreateEquipmentForm()
              vm.CreateEquipmentFormSetting.loading = false
            })
            .catch(() => {
              vm.CreateEquipmentFormSetting.loading = false
            })
        }
      })
    },
    submitRoleSkill () {
      let vm = this
      this.$refs['roleSkillForm'].validate((valid) => {
        if (valid) {
          vm.RoleSkillFormSetting.loading = true
          roleSkill(vm.roleSkillFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              vm.clearRoleSkillForm()
              vm.RoleSkillFormSetting.loading = false
            })
            .catch(() => {
              vm.RoleSkillFormSetting.loading = false
            })
        }
      })
    },
    submitOffline () {
      let that = this
      this.$refs['offlineTopUpForm'].validate((valid) => {
        if (valid) {
          that.modal1 = true
        }
      })
    },
    submitDailyRecharge () {
      let that = this
      this.$refs['dailyRechargeForm'].validate((valid) => {
        if (valid) {
          that.dailyRechargeFormSetting.loading = true
          dailyRecharge(that.dailyRechargeFormItem).then(response => {
            that.$Message.success(response.data.msg)
            that.$refs['dailyRechargeForm'].resetFields()
            that.dailyRechargeFormSetting.loading = false
          }).catch(() => {
            that.dailyRechargeFormSetting.loading = false
          })
        }
      })
    },
    submitUnique () {
      let vm = this
      getRoleUnique(vm.uniqueFormItem).then((response) => {
        vm.$Message.success(response.data.msg)
        vm.unique = response.data.data.unique
        vm.last_dungeon = response.data.data.last_dungeon
      })
    },
    submitClear () {
      let vm = this
      clearRoleWarOrder(vm.clearFormItem).then((response) => {
        vm.$Message.success(response.data.msg)
        vm.$refs['clearRoleWarOrderForm'].resetFields()
      })
    },
    submitClose () {
      let vm = this
      vm.closeFormItem.start_time = Date.parse(vm.closeFormItemTime) / 1000
      vm.closeFormItem.end_time = Date.parse(vm.closeFormItemEndTime) / 1000
      closeServer(vm.closeFormItem).then((response) => {
        vm.$Message.success(response.data.msg)
        vm.closeFormItemTime = ''
        vm.closeFormItemEndTime = ''
        vm.closeFormItem = {
          game_hash: '',
          start_time: '',
          end_time: '',
          content: ''
        }
      })
    },
    submitGm () {
      let vm = this
      add(vm.gmFormItem).then((response) => {
        vm.$Message.success(response.data.msg)
        vm.gmFormItem = {
          game_hash: '',
          message: ''
        }
      })
    },
    submitLastDungeon () {
      let vm = this
      this.$refs['lastDungeonForm'].validate((valid) => {
        if (valid) {
          vm.DungeonFormSetting.loading = true
          lastDungeon(vm.dungeonFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              vm.clearDungeonFormItem()
              vm.DungeonFormSetting.loading = false
            })
            .catch(() => {
              vm.DungeonFormSetting.loading = false
            })
        }
      })
    },
    submitAppUpdate () {
      let vm = this
      this.$refs['appUpdateForm'].validate((valid) => {
        if (valid) {
          vm.AppUpdateFormSetting.loading = true
          getAppUpdate(vm.appUpdateFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              // vm.clearAppUpdateFormItem()
              vm.appUpdateFormItem.info = response.data.data.info
              vm.AppUpdateFormSetting.loading = false
            })
            .catch(() => {
              vm.AppUpdateFormSetting.loading = false
            })
        }
      })
    },
    submitSaveAppUpdate () {
      let vm = this
      this.$refs['appUpdateForm'].validate((valid) => {
        if (valid) {
          vm.SaveAppUpdateFormSetting.loading = true
          saveAppUpdate(vm.saveAppUpdateFormItem)
            .then((response) => {
              vm.$Message.success(response.data.msg)
              vm.clearSaveAppUpdateFormItem()
              vm.SaveAppUpdateFormSetting.loading = false
            })
            .catch(() => {
              vm.SaveAppUpdateFormSetting.loading = false
            })
        }
      })
    },
    clearAvatarForm () {
      let vm = this
      vm.avatarFormItem.game_hash = ''
      vm.avatarFormItem.openid = ''
    },
    clearRoleSkillForm () {
      let vm = this
      vm.roleSkillFormItem.game_hash = ''
      vm.roleSkillFormItem.openid = ''
      vm.roleSkillFormItem.hero_id = ''
    },
    clearCreateEquipmentForm () {
      let vm = this
      vm.createEquipmentFormItem.game_hash = ''
      vm.createEquipmentFormItem.openid = ''
      vm.createEquipmentFormItem.hero_id = ''
      vm.createEquipmentFormItem.item_id = ''
      vm.createEquipmentFormItem.extra_effect_id = ''
    },
    clearDungeonFormItem () {
      let vm = this
      vm.dungeonFormItem.game_hash = ''
      vm.dungeonFormItem.openid = ''
      vm.dungeonFormItem.hero_id = ''
      vm.dungeonFormItem.last_dungeon = ''
    },
    clearAppUpdateFormItem () {
      let vm = this
      vm.appUpdateFormItem.is_test = ''
      vm.appUpdateFormItem.info = ''
    },
    clearSaveAppUpdateFormItem () {
      let vm = this
      vm.saveAppUpdateFormItem.is_test = ''
      vm.saveAppUpdateFormItem.info = ''
    },
    submitOrder () {
      let vm = this
      this.$refs['orderForm'].validate((valid) => {
        if (valid) {
          backOrder(vm.orderFormItem).then((response) => {
            vm.$Message.success(response.data.msg)
            vm.orderFormItem.order_num = ''
          })
        }
      })
    },
    submitMute () {
      let vm = this
      this.$refs['muteForm'].validate((valid) => {
        if (valid) {
          mute(vm.muteFormItem).then((response) => {
            vm.$Message.success(response.data.msg)
            vm.muteFormItem.game_hash = ''
            vm.muteFormItem.mute = ''
          })
        }
      })
    }
  }
}
</script>
